package cn.wizzer.app.user.modules.services.account;

import cn.wizzer.app.user.modules.models.UserExchange;
import cn.wizzer.app.user.modules.models.vo.ExchangeVO;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;

import java.math.BigDecimal;
import java.util.Map;

public interface UserExchangeService extends BaseService<UserExchange> {
    /**
     * 币种互换
     *
     * @param amount         金额
     * @param fromCurrencyId
     * @param toCurrencyId
     * @param appid
     * @param channel        渠道，前端(API)和后端(PLATFORM)
     * @return
     */
    UserExchange exchange(BigDecimal amount, String fromCurrencyId, String toCurrencyId, String appid, String channel);

    ExchangeVO fetchVO(String id, String appid);

    Pagination queryVO(String userCnd, String no, String appid, String fromCurrencyId, String toCurrencyId, int pageNumber, int pageSize, Long startTime, Long endTime);

    /**
     * 根据查询条件统计兑换总额
     *
     * @param userId
     * @param fromCurrencyId
     * @param toCurrencyId
     * @param pageNumber
     * @param pageSize
     * @param startTime
     * @param endTime
     * @return
     */
    Map<String, BigDecimal> searchSum(String userCnd, String no, String userId, String fromCurrencyId, String toCurrencyId, int pageNumber, int pageSize, Long startTime, Long endTime);
}
